from utils.auth import create_jwt_token, verify_jwt_token


def test_create_jwt_token():
    assert create_jwt_token({"hello": 1}) != create_jwt_token({"world": 2})
    assert create_jwt_token({"a": 1}) == create_jwt_token({"a": 1})


def test_verify_jwt_token():
    res = verify_jwt_token(create_jwt_token({"a": 1, "b": 2}))
    del res["exp"]
    assert res == {"a": 1, "b": 2}

    assert verify_jwt_token("abc") is None
